package com.example.departmentService.controller;


import com.example.departmentService.entity.RecruitmentInfo;
import com.example.departmentService.entity.dto.QueryConditions;
import com.example.departmentService.entity.vo.ProjectListVo;
import com.example.departmentService.service.IRecruitmentInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Slf4j
@Api(value = "/recruitment", tags = "招聘信息")
@RestController
@RequestMapping("/recruitment")
public class RecruitmentInfoController {

    @Autowired
    private IRecruitmentInfoService recruitmentInfoService;

    @ApiOperation(value = "添加招聘", notes = "添加招聘")
    @PostMapping("/insert")
    @CrossOrigin(origins = "*")
    public Integer insert(@RequestBody RecruitmentInfo recruitmentInfo) {
        return recruitmentInfoService.insert(recruitmentInfo);
    }

    @ApiOperation(value = "查询所有信息", notes = "查询所有信息")
    @PostMapping("/findAll")
    @CrossOrigin(origins = "*")
    public List<RecruitmentInfo> findAll() {
        List<RecruitmentInfo>  recruitmentInfos = recruitmentInfoService.findAll();
        return recruitmentInfos;
    }
}
